//
// Created by liufenglin on 20-4-10.
//
#ifndef DATA_TRANSFER_LINKQUEUE_H

#define DATA_TRANSFER_LINKQUEUE_H
#include <pthread.h>

typedef struct _LinkNode {
    char *data;
    struct _LinkNode *next;
//    struct _LinkNode *pre;
} LinkNode;


typedef struct {
    LinkNode *head;
    LinkNode *tail;
    int size;
    int capacity;
    pthread_mutex_t lock;
    pthread_cond_t notFullCond;
    pthread_cond_t notEmptyCond;

} LinkQueue;

LinkQueue *newQueue(int cap) ;

void enQueue(LinkQueue *queue, char *str);

char *deQueue(LinkQueue *queue);

void freeQueue(LinkQueue *queue);



#endif //DATA_TRANSFER_LINKQUEUE_H
